<?php 
$this->load->view('components/header'); 
$form_action = ( !empty( $customer_id ) ) ? base_url() . 'customer/exec/edit/' . $customer_id : base_url() . 'customer/exec/add' ;
?>
<img id="top" src="<?php echo base_url();?>images/top.png" alt="">
   <div id="form_container">
      <h1><a>Customer Maintenance</a></h1>
      <form id="form_169164" class="appnitro"  method="post" action="<?php echo $form_action; ?>">
         <?php if( !empty( $customer_id ) ){ echo "<input type=\"hidden\" value=\"{$customer_id}\" name=\"id\"  />"; }?>
         <div class="form_description">
            <h2>Customer Maintenance</h2>
            <p>Kingglobaltrading Customer</p>
         </div>      
         <?php if( validation_errors() ){ ?>
            <div id="error_message"><?php echo  validation_errors(); ?></div>      
         <?php } ?>      
         
         <?php if( isset( $system_message ) && !validation_errors() ){ ?>
            <div id="error_message"><?php echo $system_message; ?></div>      
         <?php } ?>   
         <ul>
            <li>
               <label class="description" for="element_1">Customer Name </label>
               <div>
                  <input class="element text large" name="customer_name" type="text" maxlength="255" value="<?php echo (isset($customer_name)? $customer_name : ''); ?>"/>
               </div> 
            </li>      
            <li>
               <label class="description" for="element_2">Address 1</label>
               <div>
                  <input type="text" class="element text small" name="address1" style="width: 400px;" value="<?php echo (isset($address1)? $address1 : ''); ?>" >
               </div> 
            </li> 
            <li>
               <label class="description" for="element_2">Address 2</label>
               <div>
                  <input type="text" class="element text small" name="address2" style="width: 400px;" value="<?php echo (isset($address2)? $address2 : ''); ?>" >
               </div> 
            </li> 
            <li>
               <label class="description" for="element_2">Address 3</label>
               <div>
                  <input type="text" class="element text small" name="address3" style="width: 400px;" value="<?php echo (isset($address3)? $address3 : ''); ?>" >
               </div> 
            </li> 
            <li>
               <label class="description" for="element_3">Contact Name </label>
               <div>
                  <input class="element text large" name="contact_name" type="text" maxlength="255" value="<?php echo (isset($contact_name)? $contact_name : ''); ?>"/>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_4">Mobile # </label>
               <div>
                  <input class="element text small" name="mobile_no" type="text" maxlength="255" value="<?php echo (isset($mobile_no)? $mobile_no : ''); ?>"/>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_5">Landline # </label>
               <div>
                  <input class="element text small" name="landline_no" type="text" maxlength="255" value="<?php echo (isset($landline_no)? $landline_no : ''); ?>"/>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_5">Fax # </label>
               <div>
                  <input class="element text small" name="fax" type="text" maxlength="255" value="<?php echo (isset($fax)? $fax : ''); ?>"/>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_5">Discount </label>
               <div>
                  <input class="element text small" name="discount" type="text" maxlength="255" value="<?php echo (isset($discount)? $discount : ''); ?>"/>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_6">Agent </label>
               <div>
                  <?php 
                     $aAttr = 'class = "element select medium"';
                     echo form_dropdown( 'agent', $agent_list, $agent_sel, $aAttr ); 
                  ?>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_7">Customer Category </label>
               <div>
                  <?php
                     $aAttr = 'class = "element select medium"';
                     echo form_dropdown( 'customer_cat', $custcat_list, $custcat_sel, $aAttr ); 
                  ?>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_8">Province </label>
               <div>
                  <?php
                     $aAttr = 'class = "element select medium"';
                     echo form_dropdown( 'province', $province_list, $province_sel, $aAttr ); 
                  ?>
               </div> 
            </li> 
            <li>
               <label class="description" for="element_8">Active </label>
               <div>
                  <input type="checkbox" name="status" <?php echo $status;?> />
               </div> 
            </li> 
            <li class="buttons">
               <input id="saveForm" class="button_text" type="submit" name="submit" value="Save" />
            </li>
         </ul>
      </form>
   </div>
   <img id="bottom" src="<?php echo base_url();?>images/bottom.png" alt="">
<?php $this->load->view('components/footer'); ?>
